export enum MongoColls {
    HOME,
    PRODUCT,
    SHOP,
    ORDER,

    USER,
    CART,
    MSG,
    COUPON,
    ADDRESS,
    FAVORITE,
    RED_PACKET,

    OTHER_SESSION,
    OTHER_PRC_REGION
}

export let MongoCfg = {
    prefix: 'xin_',
    database: 'xin',
    dev: {
        auth: { user: 'xianxin', password: 'xinshiguang'},
        servers: [{ addr: '127.0.0.1', port: 6688 }]
    },
    prod: {
        auth: { user: 'xianxin', password: 'xinshiguang'},
        servers: [ { addr: '127.0.0.1', port: 6688 }]
    },
    options: {
        server: {
            poolSize: 6,  // connection pool size for each individual server
        }
    }
};

export let MongoCollNames = (function() {
    let colls: string[] = [];
    for(let k in MongoColls) {
        if(typeof MongoColls[k] === 'number') {
            colls.push( MongoCfg.prefix + k.toLowerCase() );
        }
    }
    return colls;
}());